package demo3;

public class Test {

    public static int findNumberOfLIS(int[] nums) {
        int n = nums.length;

        int[] dp = new int[n];
        for(int i =0; i < n; i++) { dp[i] = 1;}

        int len = 1, k = 1;
        for(int i = 1; i < n; i++){
            for(int j = 0; j < i; j++){
                if(nums[i] > nums[j]){
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            if(dp[i] > len){
                len = dp[i];
                k = 1;
            }else if(dp[i] == len){
                k++;
            }
        }
        return k;
    }

    public static void main(String[] args) {
        int[] tmp = new int[]{1,3,5,4,7};
        System.out.println(findNumberOfLIS(tmp));
    }
}
